package com.api;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.component.domain.SysRoleEntity;
import com.component.service.SysRoleService;
import com.system.common.Result;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Classname SysRoleApi
 * @Description TODO
 * @Date 2023/10/1 16:17
 * @Created by XiongXiong
 * @Author: X.I.O
 */
@RestController
@RequestMapping("/role")
public class SysRoleApi {

    @Autowired
    private SysRoleService sysRoleService;

    @GetMapping("page")
    public JSONObject pageNum(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
                              @RequestParam(value = "pageSize",defaultValue = "10")Integer pageSize,
                              @RequestParam(value = "rolename",required = false)String rolename,
                              @RequestParam(value = "roleno",required = false)String roleno){
        IPage<SysRoleEntity> page=sysRoleService.page(pageNum,pageSize,roleno,rolename);
        return Result.successInfo(page);
    }
}
